package com.cby.widget.sample.bubblenavigation

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.cby.widget.sample.R
import com.cby.widget.sample.fragments.EqualBottomBarFragment

/**
 * @description: BubbleNavEqualBottomBarActivity
 *
 * @author ChenBaoyang
 * @date 2021/10/16 16:38
 */
class BubbleNavEqualBottomBarActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_bubble_nav_equal_bottom_bar)

        var fragment = supportFragmentManager.findFragmentById(R.id.content_frame) as EqualBottomBarFragment?
        if (fragment == null) {
            fragment = EqualBottomBarFragment()
            addFragment(fragment, R.id.content_frame)
        }
    }

    private fun addFragment(fragment: EqualBottomBarFragment, id: Int) {
        val ft = supportFragmentManager.beginTransaction()
        ft.add(id, fragment)
        ft.commit()
    }
}